#include "myd3dutil.h"

namespace lwd3dutil{
	int d3dDrawText(IDirect3DDevice9* Device, LPD3DXMESH pmesh, float x, float y, float z, float radx, float rady, float radz)
	{
		D3DXMATRIX p(1,0,0,0,
			0,1,0,0,
			0,0,1,0,
			x,y,z,1), Rx, Ry, Rz;
		D3DXMatrixRotationX(&Rx, radx);
		D3DXMatrixRotationY(&Ry, rady);
		D3DXMatrixRotationZ(&Rz, radz);
		Rz *= Rx*Ry*p;

		Device->SetTransform(D3DTS_WORLD,&Rz);
        if (pmesh){
            pmesh->DrawSubset(0);
        }
		return 0;
	}
}